Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODDraft


SaveToAPrevious

Document Shell

The SaveToAPrevious method copies the content of this draft to the specified previous draft of the same document.

ODDraft SaveToAPrevious (in ODDraft to);
to
A reference to the destination draft object, or kODNULL for the draft immediately previous to (below) this draft.
return value
A reference to this draft object.
DISCUSSION
If the to parameter is null, it is set to the draft immediately previous to (below) this draft. This method copies the content of all the drafts between this draft (inclusive) and the to draft (exclusive) to the to draft. It then makes all the drafts from this draft (inclusive) to the to draft (exclusive) empty. The document shell can call the CollapseDrafts method of this draft's document object to delete these empty drafts from the document.

For this method to be successful this draft must have a reference count of 1, meaning that only the caller has a reference to this draft object. In addition, there must be no outstanding drafts between this draft (exclusive) and the to draft (exclusive). An outstanding draft has a reference count greater than 0, meaning that it is being used by some object.

Calling this method is equivalent to calling the SaveToAPrevDraft method of this draft's document, passing this draft as the from parameter, and passing the same to parameter.

EXCEPTIONS
kODErrOutstandingDraft
There are outstanding drafts between this draft (exclusive) and the to draft (exclusive) or this draft has a reference count greater than 1.
SEE ALSO
The ODDocument::CollapseDrafts method (page 138).
The ODDocument::SaveToAPrevDraft method (page 144).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help